<template>
  <div class="demo">
    <p>学生姓名：{{ name }}</p>
    <p>学生年龄：{{ age }}</p>
    <button @click="showName">点我显示学生姓名</button>
  </div>
</template>

<script>
//组件交互的代码
//export default student分别暴露
export default {
  name: "Student", //开发者工具最终呈现的名字为Student
  data() {
    return {
      name: "VueCli",
      age: 25,
    };
  },
  methods: {
    showName() {
      alert(this.name);
    },
  },
};
//统一暴露
// export { student };
// export default student //默认暴露
</script>

<style>
</style>